#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int main()
{
	int n,k,i,j;
	while(~scanf("%d",&n))
	{
        int num[n][n];
        k = ceil((double)n / 2);
        for ( j = k; j > 0; j--)
        for ( i = 0; i < n; i++)
        {
            num[j - 1][i] = j;
            num[n - j][i] = j;
            num[i][j - 1] = j;
            num[i][n - j] = j;
        }
        for (i = 0; i < n; i++)
        {
            for (j = 0; j < n; j++ )
            {
                printf("%d", num[i][j]);
                if(j<n-1)
                printf(" ");
            }
            printf("\n");
        }
    }
	return 0;
}
